package com.listener;

import com.utils.SpringUtils;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

@Component
public class CSContextRefreshedEvent implements ApplicationListener<ContextRefreshedEvent> {
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        System.out.println("ContextRefreshedEvent->在刷新的时候生效,event:"+event.getApplicationContext());
        SpringUtils.ctx = event.getApplicationContext();
    }
}
